#include "util_wininput.h"

void LJMUUtilKeyInput::initKeyInput()
{
	int i;
	// Initialize all the keys to being released and not pressed.
	for(i=0; i<256; i++)
	{
		_key_state[i] = false;
	}
	return;
}

void LJMUUtilKeyInput::setWMKeyDown(unsigned int pwmkeycode)
{
	// If a key is pressed then save that state in the key array.
	_key_state[pwmkeycode] = true;
	return;
}

void LJMUUtilKeyInput::setWMKeyUp(unsigned int pwmkeycode)
{
	// If a key is released then clear that state in the key array.
	_key_state[pwmkeycode] = false;
	return;
}

bool LJMUUtilKeyInput::isKeyDown(unsigned int pkeycode)
{
	// Return what state the key is in (pressed/not pressed).
	return _key_state[pkeycode];
}